package com.dongdong.controller;

import com.dongdong.result.Result;
import com.dongdong.service.ContentService;
import com.dongdong.vo.ContentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("content")
public class ContentController {

    @Autowired
    private ContentService contentService;

    @GetMapping("findAll")
    public Result findAll(@RequestParam Long id){
        List<ContentVO> contentVO = contentService.findAll(id);
        return Result.OK().setData(contentVO);
    }
//加缓存
    @GetMapping("findAllredis")
    public Result findAllredis(@RequestParam Long id){
        List<ContentVO> contentVO = contentService.findAllredis(id);
        return Result.OK().setData(contentVO);
    }



}
